package com.wb3.meta.task;

import com.wb3.meta.api.core.service.GoodsOrdersService;
import com.wb3.meta.api.core.service.MyToysService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

@Configuration
@EnableScheduling    //开启定时任务
public class UpdateToysStatusTask {

    @Autowired
    private MyToysService myToysService;

    @Scheduled(fixedDelay = 1000 * 60 * 60 * 4)  //暂时4小时执行一次
    public void handleNoPayOrder(){
        myToysService.handleExpireToys();
    }
}
